package com.xyw.code.authentication.server.config;

import com.xyw.code.authentication.server.matcher.NewMvcRequestMatcher;
import com.xyw.code.authentication.server.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by zhoutaoo on 2018/5/25.
 */
@Component
class LoadResourceDefine {

    @Autowired
    private IMenuService menuService;

    @Bean
    public Map<NewMvcRequestMatcher, ConfigAttribute> resourceConfigAttributes() {
        return menuService.loadMenu();
    }
}
